#include "application.h"
#include "game.h"

using namespace EPOC;

// application entry point
int main(int argc, char* argv[])
{
	Application *pApplication = new Application();
	
	// Change kRENDER_MODE_SDL to kRENDER_MODE_OPENGL to enable OpenGL support, or just remove the flag all together
	//pApplication->Start("Image example", 640, 480, false);

	pApplication->Start("Image example", 1024, 768, 1, SDL_WINDOW_OPENGL, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
		
	delete pApplication;
	pApplication = NULL;

	return 0;
}

Application::Application()
{
}

Application::~Application()
{
}

// initializes the epoc core
bool Application::Initialize()
{
	// call base class initialize
	return BaseApplication::Initialize();
}

// initializes our own content manager instead of the built in one
bool Application::CreateGameManager()
{
	m_pGameManager = new Game(this);
	if(!m_pGameManager || !m_pGameManager->Initialize())
	{
		m_pGameManager->Release();
		m_pGameManager = NULL;

		return false;
	}

	return true;
}


void Application::Render(SDL_Renderer* pRenderer)
{

	BaseApplication::Render(pRenderer);

}